﻿namespace OJS.Worker
{    
    public abstract class CompileFactory
    {
        /// <summary>
        /// Create new instance of compiler compatiblity with specified language
        /// </summary>
        /// <param name="languageId">Language Identify</param>
        /// <returns>Compiler</returns>
        public static ICompiler Create(int languageId)
        {
            switch (languageId)
            {
                case 0: return new CCompiler();
                case 1: return new CPPCompiler();
                case 2: return new JavaCompiler();
                case 3: return new CSharpCompiler(); 
                default: return null;
            }
        }
    }
}
